﻿using System;
using System.Collections.Generic;
using System.Linq;
using System.Text;
using DEsbInterface;
using System.Threading;

namespace DEsbConsole
{
    class BatchSender
    {
        private IUser user;
        private IAdmin admin;

        public void Setup(IUser user, IAdmin admin)
        {
            this.user = user;
            this.admin = admin;
        }

        public void Send(object state)
        { 
            while(true)
            {
                string result = user.GetUserName("ThreadId: " + Thread.CurrentThread.ManagedThreadId, "", DateTime.Now.ToString());
                result = admin.CheckPermission(DateTime.Now.Second).ToString();

                Console.WriteLine("sent " + Thread.CurrentThread.ManagedThreadId);
            }
        }
    }
}
